// District 8 JavaScript Document


    jQuery(document).ready(function(){

        //hack for textarea width on Chrome & Safari
        if(jQuery.browser.webkit){
            jQuery('.textarea').each(function(){
                var width = jQuery(this).width() - 5; //alert(width);
                jQuery(this).css('width', width);
            });
        }
        */

        jQuery(".menu-item").hover(
        function(){
            jQuery(this).attr("src", jQuery(this).attr("src").replace(/.jpg/, "2.jpg"));
        },
        function(){
            jQuery(this).attr("src", jQuery(this).attr("src").replace(/2.jpg/, ".jpg"));
        });

        //slides
        jQuery('#slides').slides({ preload: true, preloadImage: 'images/slides/loading.gif', slideSpeed: 800, play: 3000, pause: 1000, hoverPause: true, generateNextPrev: false, generatePagination: true, effect: 'slide' });

        //gallery
        jQuery("#gallery li").hover(function() { //On hover...
            var thumbOver = jQuery(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
            //Set a background image(thumbOver) on the <a> tag - Set position to bottom
            jQuery(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

            //Animate the image to 0 opacity (fade it out)
            jQuery(this).find("span").stop().fadeTo('normal', 0 , function() { jQuery(this).hide() /*Hide the image after fade*/ });

        } , function() { //on hover out...
            //Fade the image to full opacity
            jQuery(this).find("span").stop().fadeTo('normal', 1).show();
        });

    });